<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Decodes a base64-encoded string into raw binary.</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.sodium-add.html">« sodium_add</a></li>
      <li style="float: right;"><a href="function.sodium-bin2base64.html">sodium_bin2base64 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.sodium.html">Sodium 函数</a></li>
    <li>Decodes a base64-encoded string into raw binary.</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.sodium-base642bin" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sodium_base642bin</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.2.0, PHP 8)</p><p class="refpurpose"><span class="refname">sodium_base642bin</span> &mdash; <span class="dc-title">Decodes a base64-encoded string into raw binary.</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.sodium-base642bin-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>sodium_base642bin</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$id</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$ignore</code><span class="initializer"> = &quot;&quot;</span></span>): <span class="type">string</span></div>

  <p class="para rdfs-comment">
   Converts a base64 encoded string into raw binary. Unlike <span class="function"><a href="function.base64-decode.html" class="function">base64_decode()</a></span>,
   <span class="function"><strong>sodium_base642bin()</strong></span> is constant-time (a property that is important for any code that
   touches cryptographic inputs, such as plaintexts or keys) and supports multiple character sets.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.sodium-base642bin-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">string</code></dt>

    <dd>

     <p class="para">
      <span class="type">string</span>; Encoded string.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">id</code></dt>

    <dd>

     <p class="para">
      <ul class="simplelist">
       <li class="member">
        <strong><code>SODIUM_BASE64_VARIANT_ORIGINAL</code></strong> for standard (<code class="literal">A-Za-z0-9/\+</code>)
        Base64 encoding.
       </li>
       <li class="member">
        <strong><code>SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING</code></strong> for standard (<code class="literal">A-Za-z0-9/\+</code>)
        Base64 encoding, without <code class="literal">=</code> padding characters.
       </li>
       <li class="member">
        <strong><code>SODIUM_BASE64_VARIANT_URLSAFE</code></strong> for URL-safe (<code class="literal">A-Za-z0-9\-_</code>) Base64 encoding.
       </li>
       <li class="member">
        <strong><code>SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING</code></strong> for URL-safe (<code class="literal">A-Za-z0-9\-_</code>)
        Base64 encoding, without <code class="literal">=</code> padding characters.
       </li>
      </ul>
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">ignore</code></dt>

    <dd>

     <p class="para">
      Characters to ignore when decoding (e.g. whitespace characters).
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sodium-base642bin-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Decoded string.
  </p>
 </div>



</div></div></div></body></html>